import com.github.pagehelper.PageInfo;
import com.gsj.domain.company.Company;
import com.gsj.service.company.CompanyService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath*:applicationContext*.xml")
public class Text02 {
    @Autowired
  private  CompanyService companyService;

    @Test
    public void test02(){
        System.out.println(companyService.findAll());
    }


    @Test
    public void findByPage(){
        int pageNum=2;
        int pageSize=2;
        PageInfo<Company> pageInfo = companyService.findByPage(pageNum, pageSize);
        System.out.println(pageInfo);
        System.out.println(pageInfo.getPages());
        System.out.println(pageInfo.getTotal());
    }
}
